<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>添加</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="__PUBLIC__/css/layui.css"  media="all">
    <link rel="stylesheet" href="__PUBLIC__/css/public.css"  media="all">
    <style>
    .photo{
        position: absolute;
        width: 201px;
        height: 224px;
        top: 220px;
        right: 0;
    }
    </style>
</head>
<body>
<div class="layui-conter">
    <div class="layui-col-md12">
        <div class="navigation">
            <span>其他></span><span>添加</span>
        </div>
        <div class="white-conter selsectSet">
            <div class="title-blue"><b>添加</b></div>
            <div style="margin-top: 20px">
               <form action="{:U('Other/add')}" method="post" onsubmit="return check_form();" class="layui-form">
                    <div class="layui-col-md6">
                        <div class="layui-col-md10" style="position: relative;">
							<if condition="!empty($other_data)">
                            <div class="layui-form-item">
                                <div class="label-div" style="padding-top: 25px">
                                    <label class="form-label">上级分类</label>
                                </div>
                                <div class="layui-input-inline">
                                    <select name="pid">
                                        <option value="{$other_data.id}" selected="selected">{$other_data.name}</option>
                                    </select>
                                </div>
                            </div>
							</if>
							<div class="layui-form-item">
								<div class="label-div">
									<label class="form-label">名称</label>
								</div>
								<div class="layui-input-inline">
									<input type="text" name="name" id="name" autocomplete="off" placeholder="请输入..." class="layui-input">
								</div>
							</div>
                        </div>
                    </div>
                    <div class="layui-col-md12" style="margin-top: 50px;margin-left: -50px;">
                        <div class="button-block">
                            <button class="layui-btn layui-btn-xs layui-btn-normal" lay-submit="" >提交</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>

    </div>
<script src="__PUBLIC__/js/layui.all.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
    layui.use(['form', 'layedit', 'laydate'], function(){
        var form = layui.form
            ,layer = layui.layer
            , $ = layui.jquery
            ,layedit = layui.layedit
            ,laydate = layui.laydate;
        
        form.render()

    });
</script>
<script src="__PUBLIC__/js/jquery.js"></script>
<script>
//js验证表单提交的方法
function check_form() {
	var name = $('#name').val();
	if($.trim(name) == '') {
		alert('请填写名称');
		return false;
	}
}
</script>
</div>
</body>
</html>
